{% extends "base.html" %}

{% block title %}登录 - 校园摄影投票系统{% endblock %}

{% block content %}
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4>用户登录</h4>
                </div>
                <div class="card-body">
                    <form method="POST" action="{{ url_for('main.login') }}">
                        {{ form.hidden_tag() }}
                        
                        <div class="mb-3">
                            {{ form.email.label(class="form-label") }}
                            {{ form.email(class="form-control") }}
                            {% for error in form.email.errors %}
                                <div class="invalid-feedback d-block">{{ error }}</div>
                            {% endfor %}
                        </div>
                        
                        <div class="mb-3">
                            {{ form.password.label(class="form-label") }}
                            {{ form.password(class="form-control") }}
                            {% for error in form.password.errors %}
                                <div class="invalid-feedback d-block">{{ error }}</div>
                            {% endfor %}
                        </div>
                        
                        <div class="mb-3 form-check">
                            <input type="checkbox" class="form-check-input" id="remember">
                            <label class="form-check-label" for="remember">记住我</label>
                        </div>
                        
                        <button type="submit" class="btn btn-primary">登录</button>
                    </form>
                    
                    <div class="mt-3">
                        <p>还没有账号？<a href="{{ url_for('main.register') }}">立即注册</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}